package io.gitee.zhangbinhub.admin.oauth.po

import io.swagger.v3.oas.annotations.media.Schema
import jakarta.validation.constraints.Max
import jakarta.validation.constraints.Min
import jakarta.validation.constraints.NotBlank

/**
 * @since JDK 11
 */
@Schema(description = "菜单配置参数")
data class MenuPo(
    @field:Schema(description = "菜单ID")
    var id: String? = null,

    @field:Schema(description = "应用ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @get:NotBlank(message = "应用ID不能为空")
    var appId: String? = null,

    @field:Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @get:NotBlank(message = "菜单名称不能为空")
    var name: String? = null,

    @field:Schema(description = "菜单图标", requiredMode = Schema.RequiredMode.REQUIRED)
    @get:NotBlank(message = "菜单图标不能为空")
    var iconType: String? = null,

    @field:Schema(description = "链接路径", requiredMode = Schema.RequiredMode.REQUIRED)
    var path: String? = null,

    @field:Schema(description = "上级菜单ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @get:NotBlank(message = "上级菜单ID不能为空")
    var parentId: String? = null,

    @field:Schema(description = "菜单是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
    var enabled: Boolean = true,

    @field:Schema(description = "链接打开模式；0-内嵌，1-新标签页", requiredMode = Schema.RequiredMode.REQUIRED)
    @get:Min(value = 0, message = "打开模式只能为 0 或 1")
    @get:Max(value = 1, message = "打开模式只能为 0 或 1")
    var openType: Int = 0,

    @field:Schema(description = "序号", requiredMode = Schema.RequiredMode.REQUIRED)
    var sort: Int = 0,

    @field:Schema(description = "关联角色ID")
    var roleIds: MutableList<String> = mutableListOf()
)